package com.fang.mmy.user.service.lmpl;

import com.fang.mmy.entity.ResponseResult;
import com.fang.mmy.entity.User;
import com.fang.mmy.user.mapper.UserMapper;
import com.fang.mmy.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName UserServicelmpl
 * @Author kebukeyi
 * @Date 2022/8/7 9:53
 * @Description
 * @Version 1.0.0
 */
@Service
public class UserServicelmpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public ResponseResult<User> getUserNo(Long userId) {
        User user = userMapper.selectByPrimaryKey(userId);
        if (user != null) {
            return ResponseResult.<User>builder().code(200).data(user).success(true).build();
        } else {
            return ResponseResult.<User>builder().code(400).msg("无果").success(false).build();
        }
    }
}
